package com.imooc.sell.utils;

import java.util.Random;

/**
 * Description:
 * 生成唯一主键
 *
 * @author zzy
 * @create 2017-09-08 11:28
 */
public class KeyUtil {
    /**
     * 格式时间+随机数
     */
    public static synchronized String getUniquekey() {
        Random random = new Random();
        Integer a = random.nextInt(900000) + 100000;
        return System.currentTimeMillis() + String.valueOf(a);
    }
}